﻿#include "MaterialsViscoElasticSolidsWapper.h"
#include "FITK_Kernel/FITKAppFramework/FITKMessage.h"

ViscoElasticSolids* MaterialsViscoElasticSolidsWapper::new_ViscoElasticSolids()
{
    return new ViscoElasticSolids;
}
void MaterialsViscoElasticSolidsWapper::delete_ViscoElasticSolids(ViscoElasticSolids * obj)
{
    if (obj) delete obj;
}

ViscoElasticSolids * MaterialsViscoElasticSolidsWapper::static_ViscoElasticSolids_GetViscoElasticSolids(const QString & name)
{
    return new ViscoElasticSolids(name);
}

QString MaterialsViscoElasticSolidsWapper::getName(ViscoElasticSolids * obj)
{
    if (obj)
        return obj->getName();
    return QString();
}

void MaterialsViscoElasticSolidsWapper::setName(ViscoElasticSolids * obj, const QString & name)
{
    if (!obj)return;
    bool ok = obj->setName(name);
    if (!ok) {
        AppFrame::FITKMessageError("Set Name failed !");
    }
}

void MaterialsViscoElasticSolidsWapper::setDensityPoissonRatio(ViscoElasticSolids * obj, double density, double poissonsRatio)
{
    if (!obj)return;
    bool ok = obj->setDensityPoissonRatio(density, poissonsRatio);
    if (!ok) {
        AppFrame::FITKMessageError("Set Density and Poissons Ratio failed !");
    }
}


void MaterialsViscoElasticSolidsWapper::setSpectra(ViscoElasticSolids * obj, const QString & shearModulus, const QString & dampingSpectrum)
{
    if (!obj)return;
    bool ok = obj->setSpectra(shearModulus, dampingSpectrum);
    if (!ok) {
        AppFrame::FITKMessageError("Set Spectra failed !");
    }
}

void MaterialsViscoElasticSolidsWapper::createMaterial(ViscoElasticSolids * obj, const QString & name)
{
    if (!obj)return;
    bool ok = obj->createMaterial(name);
    if (!ok) {
        AppFrame::FITKMessageError("Create Visco-Elastic Solids Material failed !");
    }
}

ViscoElasticSolids::ViscoElasticSolids(const QString & name):
    Acoustics::PyFITKMaterialsViscoElasticSolids(name)
{
}

ViscoElasticSolids::ViscoElasticSolids():
    Acoustics::PyFITKMaterialsViscoElasticSolids()
{
}
